package cn.edu.dgut.kk.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.DependsOn;

public class TestConfig {
    @Bean("kk")
    @kk
    public AccountRepository createJdbcAccountRepo() {
        return new JdbcAccountRepository();
    }

//    @Bean
//    public TransferService createTransferSvc(AccountRepository accountRepository) {
//        return new TransferServiceImpl(accountRepository);
//    }

    @Bean
    /*
        @DependsOn 依赖某个名字的Bean
     */
    @DependsOn("kk")
    public TransferService createTransferSvc() {
        return new TransferServiceImpl(createJdbcAccountRepo());
    }

}
